#include "CutPage.hpp"
#include "AlignPage.hpp"
#include "CompressPage.hpp"
#include "ConcatPage.hpp"

//#include "opencv2413.hpp"


#ifdef _DEBUG
#pragma comment(lib, "opencv_world341d.lib")   
#else
#pragma comment(lib, "opencv_world341.lib") 
#endif



int main3()
{
	std::vector<cv::Mat> m(2);
	//m[1] = cv::imread("C:/bmp/IMG_0003.bmp");
	m[1] = cv::imread("fusion5.png");
	m[0] = cv::imread("C:/bmp/IMG_0005.bmp");

	cv::Mat outmm;
	//fusionoffset3(outmm, m[0], cv::Rect(0, m[0].rows/2, m[0].cols, m[0].rows/2), m[1], cv::Rect(0, 0, m[1].cols, m[1].rows/2), -0.028, 0.001, 5, 0.9, 10);
	
	AlignPage::FusionOffset3(outmm, m[0], cv::Point(4100, 1047), m[1], cv::Point(4250, 12820));

	//AlignPage::FusionOffset3(outmm, m[0], cv::Point(481, 8451),  cv::Point(8399, 5852),  m[1], cv::Point(470, 2902), cv::Point(8306, 60));
	
	cv::imwrite("fusion6.png", outmm);

	cv::waitKey();
	

	
	return 4;
}


int main(int argc, char** argv)
{
	
	return main3();

	if (argc == 3)
	{
		if (std::string(argv[1]).compare("cut") == 0)
			CutPage().RunCut(argv[2], "cut.xml");
		if (std::string(argv[1]).compare("cat") == 0)
			ConcatPage().RunCat(argv[2], "cat.xml");
		if (std::string(argv[1]).compare("com") == 0)
			CompressPage().RunCom(argv[2], "com.xml");	

		if (std::string(argv[1]).compare("aln") == 0)
		{
			std::vector<cv::Mat> m(2);
			m[1] = cv::imread("C:/bmp/IMG_0001.bmp");
			m[0] = cv::imread("C:/bmp/IMG_0002.bmp");

			cv::Mat outm;

			AlignPage::FusionOffset2(outm, m[0], m[1]);

			cv::imwrite("outm.png", outm);
		}


		if (std::string(argv[1]).compare("aln") == 0)
		{
			std::vector<cv::Mat> m(2);
			m[1] = cv::imread("C:/bmp/IMG_0003.bmp");
			m[0] = cv::imread("C:/bmp/IMG_0004.bmp");

			cv::Mat outmm;

			AlignPage::FusionOffset3(outmm, m[0], cv::Point(3737, 6052), m[1], cv::Point(3650, 405));

			//AlignPage::FusionOffset3(outmm, m[0], cv::Point(481, 8451),  cv::Point(8399, 5852),  m[1], cv::Point(470, 2902), cv::Point(8306, 60));

			cv::imwrite("fusion5.png", outmm);

		}

		return 1;
	}


	



	printf("end\n");
	return 0;
}